Fix or suppress GCC warnings during build. Summary: Currently a number of GCC warnings are emitted when building libc++. This patch fixes or ignores all of them. The primary changes are: * Work around strict aliasing issues in `typeinfo::hash_code()` by using __attribute__((may_alias)). However I think a non-aliasing `hash_code()` implementation is possible. Further investigation needed. * Add `_LIBCPP_UNREACHABLE()` to switch in `strstream.cpp` to avoid -Wpotentially-uninitialized. * Fix -Wunused-value warning in `__all` by adding a void cast. * Ignore -Wattributes for now. There are a number of real attribute issues when using GCC but enabling the warning is too noisy. * Ignore -Wliteral-suffix since it warns about the use of reserved identifiers. Note Only GCC 7.0 supports disabling this warning. * Ignore -Wc++14-compat since it warns about the sized new/delete overloads. Reviewers: EricWF Differential Revision: https://reviews.llvm.org/D24003 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@280007 91177308-0d34-0410-b5e6-96231b3b80d8 
diff --git a/include/__config b/include/__config index 353ca10..bd3f59a 100644 --- a/include/__config +++ b/include/__config 
@@ -691,6 +691,12 @@  #define _NOALIAS  #endif   +#ifdef __GNUC__ +#define _LIBCPP_MAY_ALIAS __attribute__((__may_alias__)) +#else +#define _LIBCPP_MAY_ALIAS +#endif +  #if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__)  # define _LIBCPP_EXPLICIT explicit  #else